<!doctype html>
<html>
	<head>
		<title>羽乐汇</title>
		<meta name="keywords" content="羽毛球，球会，球场，教练">
		<meta name="charset" content="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1" />
		<link rel="stylesheet" type="text/css" href="__PUBLIC__/CSS/HomePage/bootstrap.min.css">
		<!-- <link rel="stylesheet" type="text/css" href="__PUBLIC__/CSS/HomePage/wap_index.css"> -->
		<link rel="stylesheet" type="text/css" href="__PUBLIC__/CSS/HomePage/index.css">
		
		<script type="text/javascript" src="__PUBLIC__/JS/HomePage/jquery.min.js"></script>
		<script type="text/javascript" src="__PUBLIC__/JS/jquery-form.js"></script>
		<script type="text/javascript" src="__PUBLIC__/JS/HomePage/bootstrap.min.js"></script>
		<script type="text/javascript" src="__PUBLIC__/JS/HomePage/md5.js"></script>
		<script type="text/javascript" src="__PUBLIC__/JS/query-object.js"></script>
		<script type="text/javascript" src="__PUBLIC__/JS/HomePage/yuleclub.js"></script>
    </head>
	<body>
		<div class="container-fluid  visible-lg visible-md pc_index">
			<div class="top">
				<div class="ttop">
					<span>欢迎来到羽乐汇</span>
					<div>
						<span class="wellcome"></span>
						<span class="login">
							<a href="<{:U('Index/index')}>">返回</a>
							<!-- <button class="notlogin_btn">注销</button> -->
							<a href="<{:U('Index/registration')}>">注册</a>
							
						</span>
						<!-- <button class="sign_btn">注册</button> -->
						<a class="login_after" href="<{:U('User/index')}>">个人主页</a>
						<a href="__PUBLIC__/HTML/vip_center.html">vip中心</a>
					</div>
				</div>
				<div>
					<img src="__PUBLIC__/PICTURE/HomePage/logo.jpg">
				</div>
				<div class="main_nav">
					<ul>
						<li><a href="<{:U('Index/index')}>">首页</a></li>
						<li><a href="<{:U('Gymnasium/index')}>">球场</a></li>
						<li><a href="<{:U('Club/index')}>">球会</a></li>
						<li>培训</li>
						<li><a href="<{:U('Activity/activity')}>">活动</a></li>
						<li><a href="<{:U('Coach/index')}>">教练</a></li>
						<li>竞赛</li>
						<li><a href="<{:U('Announce/index')}>">公告</a></li>
					</ul>
				</div>
			</div>
		</div>
		<div class="container-fluid login_box ">
			<header class="row visible-xs visible-sm">
				<ul>
					<li><a href="<{:U('Index/index')}>"><img src="__PUBLIC__/PICTURE/HomePage/pre.png"/></a></li>
					<li><span>会员登录</span></li>
				</ul>

			</header>
			<form action="__URL__/userLoginHandel" id="login_box" method="POST" class="row" >
				<div class="login_type row">
					<div>
						<label>用户名</label><input id="username" name="name" type="text" value=""/><span class="login_error"></span>
					</div>
					<div>
						<label>密码</label><input id="userpassword" name="password" type="password"/>
					</div>
					<div>
						<label>验证码</label><input id="userverify" type="text" name="verify"><span class="check_error"></span>
					</div>
					<div>
						<label></label>
						<img title="点击刷新" onclick="verifyingNew()" name="check_img" src="<{:U('Index/myVerify',array())}>">						
					</div>
					
					<div>
						<label></label>
						<input  id="login_box_btn" type="submit" value="登录"/>
						<a id="login_seccess" href="#"></a>
						<a href="<{:U('Index/registration')}>">注册</a> 
					</div>
				</div>
			</form>
		</div>
		<div class="foot row">
				<div>
					<p>联系我们</p>
					<p>关于我们</p>
					<p>加入我们</p>
				</div>
				<div>
					<p>电话：400-800-8888 周一至周六9：00-18：00</p>
					<p>[羽乐汇]<a href="http://oto.my3w.com">http://oto.my3w.com</a></p>
				</div>
		</div>
		<script type="text/javascript">
			$(function(){
				$('.login_error').css({display:'none'});
				$('.check_error').css({display:'none'});
			});
			var if_login_failed;
			var username;
			$('#login_box_btn').bind('click',function(){
				if(!$('#username').val()){
					$('.login_error').html("用户名不能为空！！").css({display:'inline'});
					return false;
				}
				else{
					$('.login_error').css({display:'none'});
					$('.check_error').css({display:'none'});
				}
				if(!$('#userverify').val()){
					$('.check_error').html("验证码不能为空！！").css({display:'inline'});
					return false;
				}
				else{
					$('.check_error').css({display:'none'});
				}
	   			$('#login_box').ajaxForm({
        			success:login1,  
        			fail:login2,
        			dataType: 'json'
    			});
			});
			function login1(data){
				if_login_failed=data.if_login_failed;
				username=data.username;
				if(if_login_failed==0){
					// 将username放进cookie
					var expdate=new Date();
					expdate.setTime(expdate.getTime() + 2 * 24 * 60 * 60 * 1000); 
					document.cookie = "username"+"="+username+";expires="+expdate.toGMTString()+";path=/";
					queryObject.remove('a');
					// window.location.href="__URL__/returnIndex";
					var a_href="<{:U('Login/returnIndex')}>"+"&user_name="+username;
					$('#login_seccess').attr("href",a_href);
					document.getElementById('login_seccess').click();
				}
				else if(if_login_failed==1 || if_login_failed==2){
					verifyingNew();
					$('.login_error').html("用户名或密码错误！！").css({display:'inline'});
			    }else if(if_login_failed==3){
			    	verifyingNew();
					$('.check_error').html("验证码错误！！").css({display:'inline'});
			    }
			}
			function login2(data){
				alert("failed");
			}
		</script>
	</body>
</html>